﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using Unis.Framework.ORM.BaseDefiniens.Enums;

namespace Unis.ORM.Persistence
{
    public class EntityDbCommandInfo
    {
        // Fields
        private object _DataEntity;
        private DbCommand _DbCommand;
        private bool _IsMainEntity;
        private bool _IsPartPropertyUpdate;
        private OperationType _OperationType;

        // Methods
        public EntityDbCommandInfo(object dataEntity, DbCommand dbCommand)
            : this(dataEntity, dbCommand, false)
        {
        }

        public EntityDbCommandInfo(object dataEntity, DbCommand dbCommand, bool isMainEntity)
        {
            this._DataEntity = dataEntity;
            this._DbCommand = dbCommand;
            this._IsMainEntity = isMainEntity;
            this._OperationType = OperationType.None;
        }

        // Properties
        public object DataEntity
        {
            get
            {
                return this._DataEntity;
            }
            set
            {
                this._DataEntity = value;
            }
        }

        public DbCommand DbCommand
        {
            get
            {
                return this._DbCommand;
            }
            set
            {
                this._DbCommand = value;
            }
        }

        public bool IsMainEntity
        {
            get
            {
                return this._IsMainEntity;
            }
            set
            {
                this._IsMainEntity = value;
            }
        }

        public bool IsPartPropertyUpdate
        {
            get
            {
                return this._IsPartPropertyUpdate;
            }
            set
            {
                this._IsPartPropertyUpdate = value;
            }
        }

        public OperationType OperationType
        {
            get
            {
                return this._OperationType;
            }
            set
            {
                this._OperationType = value;
            }
        }
    }
}
